import request from '@/utils/request'

/**
 * 商户列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getMerchantList(params) {//商户列表
  return request({
    url: '/cloudApi/merchant/merchant/getMerchantList',
    method: 'get',
    params
  })
}


export function queryMerchant(params) {//查询商户
  return request({
    url: '/cloudApi/merchant/merchant/getByMchId',
    method: 'get',
    params
  })
}
/**
 *  新增商户
 */
export function saveMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/merchant/saveMerchant',
    method: 'post',
    data
  })
}
// 编辑
export function reviseMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/merchant/updateMerchant',
    method: 'post',
    data
  })
}
//新建门店
export function addShopMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/store/saveStore',
    method: 'post',
    data
  })
}
// 修改门店
export function reviseShopMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/store/updateStore',
    method: 'post',
    data
  })
}

//门店列表
export function shopMerchabt(params) {
  return request({
    url: '/cloudApi/merchant/store/getStoreList',
    method: 'get',
    params
  })
}

//门店详情
export function shopDetil(params) {
  return request({
    url: '/cloudApi/merchant/store/getById',
    method: 'get',
    params
  })
}

//设备列表
export function deviceMerchabt(params) {
  return request({
    url: '/cloudApi/merchant/equipment/getEquipmentList',
    method: 'get',
    params
  })
}

//新增设备
export function addEquipment(data) {
  return request({
    url: '/cloudApi/merchant/equipment/saveEquipment',
    method: 'post',
    data
  })
}

//供应商审核
export function auditMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/merchant/auditMerchant',
    method: 'post',
    data
  })
}

//省市区
export function provinceMerchabt(params) {
  return request({
    url: '/cloudApi/sys/getArea',
    method: 'get',
    params
  })
}

//街道接口
export function streetMerchabt(params) {
  return request({
    url: '/cloudApi/sys/getAreaByParentId',
    method: 'get',
    params
  })
}

//绑定设备
export function equipmentMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/equipment/bindEquipment',
    method: 'post',
    data
  })
}

//设备列表里修改门店
export function compileShopMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/store/storeBind',
    method: 'post',
    data
  })
}

//设备列表里的解绑
export function UnlinkShopMerchabt(data) {
  return request({
    url: '/cloudApi/merchant/equipment/removeBindEquipment',
    method: 'post',
    data
  })
}

//商户收益
export function IncomeMerchabt(params) {
  return request({
    url: '/cloudApi/merchant/account/getAccountList',
    method: 'get',
    params
  })
}